<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="../layout/admin_template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message"/>
    

        <rich:panel>
            <f:facet name="header">快餐店信息</f:facet>
    
        <table>
          <tr class="prop">
            <td class="name">店名:</td>
            <td class="value">#{newSnackShop.name}</td>
          </tr>
          <tr class="prop">
            <td class="name">电话号码:</td>
            <td class="value">#{newSnackShop.telNo}</td>
          </tr>
          <tr class="prop">
            <td class="name">地址:</td>
            <td class="value">#{newSnackShop.address}</td>
          </tr>
          <tr class="prop">
            <td class="name">备注:</td>
            <td class="value">#{newSnackShop.memo}</td>
          </tr>

        </table>
            <div style="clear:both"/>
      </rich:panel>  


      <!-- actions -->
      <div class="actionButtons">
        <s:button view="/admin/editSnackShop.xhtml" value="编辑" styleClass="inputButton"/>
        <s:button action="#{snackShopAction.remove}" value="删除" rendered="#{snackShopAction.managed}" styleClass="inputButton"/>
        <s:button view="/admin/snackShopList.xhtml" value="返回" styleClass="inputButton"/>
      </div>
      <br/>
        <rich:panel>
            <f:facet name="header">菜单列表</f:facet>
    	<table>
    		<tr valign="top">
    			<td>
			        <table style="width: 150px;">
			          <tr class="prop">
			            <td colspan="2">   星期一</td>
			          </tr>
			          <ui:repeat value="#{appUtils.getMonDishes(newSnackShop)}" var="dish">
				          <tr class="prop">
				            <td>#{dish.no}</td>
				            <td>
				            	<s:link view="/admin/editDish.xhtml" value="#{dish.name}">
				            		<f:param name="dishId" value="#{dish.id}" />
				            		<f:param name="shopId" value="#{snackShopAction.id}" />
				            	</s:link>
				            </td>
				          </tr>	 
			          </ui:repeat>
			        </table>    			
    			</td>
    			<td>
			        <table style="width: 150px;">
			          <tr class="prop">
			            <td colspan="2">   星期二</td>
			          </tr>
			          <ui:repeat value="#{appUtils.getTuesDishes(newSnackShop)}" var="dish">
				          <tr class="prop">
				            <td>#{dish.no}</td>
				            <td>
				            	<s:link view="/admin/editDish.xhtml" value="#{dish.name}">
				            		<f:param name="dishId" value="#{dish.id}" />
				            		<f:param name="shopId" value="#{snackShopAction.id}" />
				            	</s:link>
				            </td>
				          </tr>	 
			          </ui:repeat>
			        </table>    			
    			</td>
    			<td>
			        <table style="width: 150px;">
			          <tr class="prop">
			            <td colspan="2">   星期三</td>
			          </tr>
			          <ui:repeat value="#{appUtils.getWedDishes(newSnackShop)}" var="dish">
				          <tr class="prop">
				            <td>#{dish.no}</td>
				            <td>
				            	<s:link view="/admin/editDish.xhtml" value="#{dish.name}">
				            		<f:param name="dishId" value="#{dish.id}" />
				            		<f:param name="shopId" value="#{snackShopAction.id}" />
				            	</s:link>
				            </td>
				          </tr>	 
			          </ui:repeat>
			        </table>    			
    			</td> 
    			<td>
			        <table style="width: 150px;">
			          <tr class="prop">
			            <td colspan="2">   星期四</td>
			          </tr>
			          <ui:repeat value="#{appUtils.getThuDishes(newSnackShop)}" var="dish">
				          <tr class="prop">
				            <td>#{dish.no}</td>
				            <td>
				            	<s:link view="/admin/editDish.xhtml" value="#{dish.name}">
				            		<f:param name="dishId" value="#{dish.id}" />
				            		<f:param name="shopId" value="#{snackShopAction.id}" />
				            	</s:link>
				            </td>
				          </tr>	 
			          </ui:repeat>
			        </table>    			
    			</td>  
    			<td>
			        <table style="width: 150px;">
			          <tr class="prop">
			            <td colspan="2">   星期五</td>
			          </tr>
			          <ui:repeat value="#{appUtils.getFriDishes(newSnackShop)}" var="dish">
				          <tr class="prop">
				            <td>#{dish.no}</td>
				            <td>
				            	<s:link view="/admin/editDish.xhtml" value="#{dish.name}">
				            		<f:param name="dishId" value="#{dish.id}" />
				            		<f:param name="shopId" value="#{snackShopAction.id}" />
				            	</s:link>
				            </td>
				          </tr>	 
			          </ui:repeat>
			        </table>    			
    			</td> 
    			<td>
			        <table style="width: 150px;">
			          <tr class="prop">
			            <td colspan="2">   星期六</td>
			          </tr>
			          <ui:repeat value="#{appUtils.getSatDishes(newSnackShop)}" var="dish">
				          <tr class="prop">
				            <td>#{dish.no}</td>
				            <td>
				            	<s:link view="/admin/editDish.xhtml" value="#{dish.name}">
				            		<f:param name="dishId" value="#{dish.id}" />
				            		<f:param name="shopId" value="#{snackShopAction.id}" />
				            	</s:link>
				            </td>
				          </tr>	 
			          </ui:repeat>
			        </table>    			
    			</td>   
    			<td>
			        <table style="width: 150px;">
			          <tr class="prop">
			            <td colspan="2">   星期日</td>
			          </tr>
			          <ui:repeat value="#{sappUtils.getSunDishes(newSnackShop)}" var="dish">
				          <tr class="prop">
				            <td>#{dish.no}</td>
				            <td>
				            	<s:link view="/admin/editDish.xhtml" value="#{dish.name}">
				            		<f:param name="dishId" value="#{dish.id}" />
				            		<f:param name="shopId" value="#{snackShopAction.id}" />
				            	</s:link>
				            </td>
				          </tr>	 
			          </ui:repeat>
			        </table>    			
    			</td>      			  			     			    			
    		</tr>
    	</table>
            <div style="clear:both"/>
      </rich:panel>  
  		
  		<br/> 
  		
 		<h:form id="form">
        <rich:panel>
            <f:facet name="header">添加菜</f:facet>
            <s:decorate id="noDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">菜序号</ui:define>
                <h:inputText id="no" required="true" value="#{snackShopAction.newDish.no}">
                </h:inputText>
            </s:decorate>
            <s:decorate id="nameDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">菜名</ui:define>
                <h:inputText id="name" required="true"
                             value="#{snackShopAction.newDish.name}"/>
            </s:decorate>
            <s:decorate id="descriptionDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">描述</ui:define>
				<h:inputTextarea id="description" value="#{snackShopAction.newDish.description}" cols="50" rows="5">
					
				</h:inputTextarea>
            </s:decorate>
            <s:decorate id="selectDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">星期</ui:define>
				<h:selectOneMenu id="select" value="#{snackShopAction.selectOption}">
					<f:selectItems value="#{snackShopAction.selectOptions}"/>
				</h:selectOneMenu>
            </s:decorate> 
            <div style="clear:both"/>
      </rich:panel>  
      
      <!-- actions -->
      <div class="actionButtons">
        <h:commandButton action="#{snackShopAction.addDishToSnackShop}" value="添加" styleClass="inputButton"/>
      </div>  
      </h:form>    
</ui:define>

</ui:composition>

